package com.ruoyi.project.system.domain.vo;

import com.ruoyi.project.system.domain.SmProduct;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@NoArgsConstructor
public class ProductVo {

    private Integer id;

    private String name;

    private String introduce;

    private String scene;

    private BigDecimal basePricing;

    private BigDecimal promotionAdd;

    private BigDecimal basePriceAdd;

    public ProductVo(SmProduct smProduct) {
        this.name = smProduct.getName();
        this.introduce = smProduct.getIntroduce();
        this.scene = smProduct.getScene();

        this.promotionAdd = smProduct.getPromotionAdd().setScale(2, BigDecimal.ROUND_DOWN);
        this.basePriceAdd = smProduct.getBasePriceAdd().setScale(2, BigDecimal.ROUND_DOWN);
    }

    public ProductVo(SmProduct smProduct, Integer p) {
        this.id = smProduct.getId();
        this.name = smProduct.getName();
        this.promotionAdd = smProduct.getPromotionAdd().setScale(2, BigDecimal.ROUND_DOWN);
        this.basePriceAdd = smProduct.getBasePriceAdd().setScale(2, BigDecimal.ROUND_DOWN);
    }


}
